#include "SQLDropProcedureStatement.h"

#include "SQLDDLStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"
#include "../../../DbType.h"
#include "../../../utils/instanceof.h"

SQLDropProcedureStatement::SQLDropProcedureStatement()
{
}

SQLDropProcedureStatement::SQLDropProcedureStatement(DbType_ptr  dbType)
    : SQLStatementImpl(dbType)
{
}

void SQLDropProcedureStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLDropProcedureStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLDropProcedureStatement));
}

SQLName_ptr SQLDropProcedureStatement::getName()
{
  return name;
}

void SQLDropProcedureStatement::setName(SQLName_ptr name)
{
  if (name != NULL)
  {
    name->setParent(SharedObject(SQLDropProcedureStatement));
  }
  this->name = name;
}

BOOL_ptr SQLDropProcedureStatement::isIfExists()
{
  return ifExists;
}

void SQLDropProcedureStatement::setIfExists(BOOL_ptr ifExists)
{
  this->ifExists = ifExists;
}

SQLDDLStatement::DDLObjectType SQLDropProcedureStatement::getDDLObjectType()
{
  return SQLDDLStatement::DDLObjectType::PROCEDURE;
}
